﻿using System;

using Matrix.Xmpp.Client;

using SBPweb.Communication.Shared.Library.Commands;

namespace SBPweb.Communication.Client.Library.Xmpp.Commands
{

    public abstract class Command<TRequest, TResponse> : CommandBase<TRequest, TResponse>
        where TRequest : Iq
        where TResponse : Iq
    {

        #region Protected fields

        protected TRequest requestIq;
        protected TResponse responseIq;

        #endregion

        #region Constructor logic

        internal Command()
        {
        }

        internal protected Command(TRequest iq)
        {
            this.requestIq = iq;
        }

        #endregion

    }

    internal class Command : Command<Iq, Iq>
    {

        #region Constructor logic

        internal Command(Iq iq)
            : base(iq)
        {
        }

        #endregion

        #region Methods

        public override Iq GetTypedRequest()
        {
            return requestIq;
        }

        public override void PutTypedResponse(Iq response)
        {
            responseIq = response;
        }

        #endregion

    }

}